<%@page contentType="text/html; charset=UTF-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<%
	String path =request.getContextPath();
%>
<head>
    <meta http-equiv="x-ua-compatible" content="ie=7" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <script language="javascript" type="text/javascript" src="<%=path%>/js/validatorTool.js"></script>
	<script language="javascript" type="text/javascript" src="<%=path%>/js/utilTool.js"></script>
	
    <script src="<%=path%>/js/jquery-1.4.4.js" type="text/javascript"></script>
    <script src="<%=path%>/js/jquery.cookie.js" type="text/javascript"></script>
    <script src="<%=path%>/js/jquery.treeview.js" type="text/javascript"></script> 
	
	<script language="javascript" type="text/javascript">
		function saveArrPlan(){
			var sendNnums=document.getElementsByName("sendNnum");
			if(sendNnums.length>0){
				for(var i=0;i<sendNnums.length;i++){
					if(sendNnums[i].value==null || sendNnums[i].value==""){
						alert("第"+(i+1)+"行发货数量不能为空");
						return ;
					}
				}
			}	
			form2.action="<%=path%>/other/sendPlanSave";
			form2.submit();
		}
		
		function exportData(){
			form1.action="<%=path%>/other/exportSendPlan?isList=y";
			form1.submit();
		}
		
		function qryData(){
			form1.action="<%=path%>/other/qrySendPlan";
			form1.submit();
		}
		
		function resetPlanData(){
			document.getElementById("qryOrderNo").value="";
			document.getElementById("qryProdName").value="";
			document.getElementById("qrySendBeginDate").value="";
			document.getElementById("qrySendEndDate").value="";
			document.getElementById("qryPlanArrBeginDate").value="";
			document.getElementById("qryPlanArrEndDate").value="";
		}
		
	</script>
</head>
<body class="fullbody">
            <div class="context">
                <div class="position">
                    <div class="tposi">当前位置：
                        <a href="javascript:changeMenu(1,'<%=path%>/infopub/pubmain?menuid=1');"class="linkstyle">首页</a>&nbsp;&gt;&gt;&nbsp;
                   		<a href="javascript:changeMenu(3,'');" class="linkstyle">我的订单\合同</a>&nbsp;&gt;&gt;&nbsp;
                        <span class="curposition">发货计划维护</span>
                    </div>
                    <div class="help">
						<a href="javascript:void(null);" onclick="doHelp('<%=request.getContextPath()%>/help/html/FHJHWH.html');" class="linkstyle">帮助</a>
					</div>
                </div>
                <div class="margin8"></div>
                <div class="subpage_title">
                    <div class="title_index">
                        <img src="<%=path%>/images/common/dot03.gif" alt="" border="0" />&nbsp;发货计划维护</div>
                </div>
                <div class="subpage_bidlist">
                    <div class="subpage_search" >
                    	<form name="form1" action="<%=path%>/other/qrySendPlan" method="post">
	                        <table border="0" cellpadding="0" cellspacing="0" class="searchtable">
	                            <tr>
	                                <td valign="middle" class="w_1">订单号：</td>
	                                <td valign="middle" class="w_2">
	                                    <input id="qryOrderNo" name="qryOrderNo" type="text" value="${qryOrderNo}" class="searchtext" />
	                                </td>
	                            	<td valign="middle" class="w_1">产品名称：</td>
	                                <td valign="middle" class="w_2">
	                                    <input id="qryProdName" name="qryProdName" type="text" value="${qryProdName}" class="searchtext" />
	                                </td>
	                            </tr>
	                            <tr>
	                                <td valign="middle" class="w_1">发货日期：</td>
	                                <td valign="middle" class="w_2">
	                                    <input id="qrySendBeginDate" name="qrySendBeginDate" type="text" 
	                                    	onclick="return showCalendar('qrySendBeginDate', 'y-mm-dd');" 
	                                    	readonly="readonly" value="${qrySendBeginDate}" class="searchdate" />&nbsp;至&nbsp;
	                                    <input id="qrySendEndDate" name="qrySendEndDate" type="text" 
	                                    	onclick="return showCalendar('qrySendEndDate', 'y-mm-dd');"
	                                    	readonly="readonly" value="${qrySendEndDate}" class="searchdate" />
	                                </td>
	                               <td valign="middle" class="w_1"> 计划到货日期：</td>
	                                <td valign="middle" class="w_2">
	                                    <input id="qryPlanArrBeginDate" name="qryPlanArrBeginDate" type="text" 
	                                    	onclick="return showCalendar('qryPlanArrBeginDate', 'y-mm-dd');"
	                                    	readonly="readonly" value="${qryPlanArrBeginDate}" class="searchdate" />&nbsp;至&nbsp;
	                                    <input id="qryPlanArrEndDate" name="qryPlanArrEndDate" type="text" 
	                                    	onclick="return showCalendar('qryPlanArrEndDate', 'y-mm-dd');" 
	                                    	readonly="readonly" value="${qryPlanArrEndDate}" class="searchdate" />
	                                </td>
	                            </tr>
	                            <tr><td colspan="4">&nbsp;</td></tr>
	                            <tr>
	                                <td valign="middle" colspan="4" align="center">
	                                    <input type="button" class="btnscs" value="查询" onclick="qryData()"/>&nbsp;&nbsp;
	                                    <input type="button" class="btnscs" value="取消" onclick="resetPlanData()"/>&nbsp;&nbsp;
	                                    <input type="button" class="btnscs" value="导出" onclick="exportData()" <c:if test="${sendPlanForms==null}">disabled</c:if>/>
	                                </td>
	                            </tr>
	                        </table>
	               		</form>
                    </div>
                    <div>
                    	<form name="form2"   method="post" >
                    		<input id="pk_send_notice" type="hidden" name="pk_send_notice" value="${pk_send_notice}" />
                    		<input id="billstatus" type="hidden" name="billstatus" value="${billstatus}" />
	                        <table class="tableCss" cellpadding="0" cellspacing="0" >
								<tr  class="titleTr" >
	                                <th width="170px">到货计划号</th>
	                                <th width="240px">产品</th>
	                                <th width="100px">发货数量</th>
	                                <th width="140px">发货日期</th>
	                                <th width="150px" class="th1">其它</th>
	                            </tr>
	                            <c:if test="${sendPlanForms!=null}">
	                                <%
	                                	int j=0;
	                                %>
									<c:forEach items="${sendPlanForms}" var="sendPlanForm" varStatus="index">
			                            <c:if test="${sendPlanForm!=null}">
											<c:if test="${sendPlanForm.index%2==1}">
												<tr align="left" class="contTr-old"  >
											</c:if>
											<c:if test="${sendPlanForm.index%2==0}">
												<tr align="left" class="contTr-even">
											</c:if>
												<td class="td3">
													<input type="hidden" name="pkOrder" value="${sendPlanForm.pkOrder}" />
													<input type="hidden" name="pkItemOrder" value="${sendPlanForm.pkItemOrder}" />
													<input type="hidden" name="pkArrPlan" value="${sendPlanForm.pkArrPlan}" />
													<input type="hidden" name="pkProd" value="${sendPlanForm.pkProd}" />
													<input type="hidden" name="orderNo" value="${sendPlanForm.orderNo}" />
													<input type="hidden" name="orderItemNo" value="${sendPlanForm.orderItemNo}" />
													<input type="hidden" name="arrPlanNo" value="${sendPlanForm.arrPlanNo}" />
													<input type="hidden" name="prodName" value="${sendPlanForm.prodName}" />
													<input type="hidden" name="model" value="${sendPlanForm.model}" />
													<input type="hidden" name="type" value="${sendPlanForm.type}" />
													<input type="hidden" name="desc" value="${sendPlanForm.desc}" />
													<input type="hidden" name="batchno" value="${sendPlanForm.batchno}" />
													<input type="hidden" name="receiveCorpName" value="${sendPlanForm.receiveCorpName}" />
													<input type="hidden" name="receiveAdsName" value="${sendPlanForm.receiveAdsName}" />
													<input type="hidden" name="hts" value="${sendPlanForm.hts}" />
													<input type="hidden" name="bts" value="${sendPlanForm.bts}" />
													<input type="hidden" name="bbts" value="${sendPlanForm.bbts}" />
													<input type="hidden" name="pkGroup" value="${sendPlanForm.pkGroup}" />
													<input type="hidden" name="pkOrg" value="${sendPlanForm.pkOrg}" />
													<input type="hidden" name="pkOrg_v" value="${sendPlanForm.pkOrg_v}" />
													<input type="hidden" name="arrStoorgName" value="${sendPlanForm.arrStoorgName}" />
													<input type="hidden" name="changeRate" value="${sendPlanForm.changeRate}" />
													<input type="hidden" name="pkProd_v" value="${sendPlanForm.pkProd_v}" />
													<input type="hidden" name="pkArrStroorg" value="${sendPlanForm.pkArrStroorg}" />
													<input type="hidden" name="pkArrStroorg_v" value="${sendPlanForm.pkArrStroorg_v}" />
													<input type="hidden" name="qtUnitRate" value="${sendPlanForm.qtUnitRate}" />
													<input type="hidden" name="prodCode" value="${sendPlanForm.prodCode}" />
													
													<input type="hidden" name="orderMainNum" value="${sendPlanForm.orderMainNum}" />
													<input type="hidden" name="pkMainUnit" value="${sendPlanForm.pkMainUnit}" />
													<input type="hidden" name="mainUnitName" value="${sendPlanForm.mainUnitName}" />
													<input type="hidden" name="orderAsisNum" value="${sendPlanForm.orderAsisNum}" />
													<input type="hidden" name="pkAsisUnit" value="${sendPlanForm.pkAsisUnit}" />
													<input type="hidden" name="asisUnitName" value="${sendPlanForm.asisUnitName}" />
													<input type="hidden" name="ordernum" value="${sendPlanForm.ordernum}" />
													<input type="hidden" name="pkMeasure" value="${sendPlanForm.pkMeasure}" />
													<input type="hidden" name="measureName" value="${sendPlanForm.measureName}" />
													<input type="hidden" name="leftNum" value="${sendPlanForm.leftNum}" />
													
													${sendPlanForm.arrPlanNo}
												</td>
												<td class="td3">
													<span class="prodName">${sendPlanForm.prodName}</span><br/>
													<c:if test="${sendPlanForm.model!=null && ''!=sendPlanForm.model}">
														规格：${sendPlanForm.model} <br/>
													</c:if>
													<c:if test="${sendPlanForm.type!=null && ''!=sendPlanForm.type}">
														型号：${sendPlanForm.type}<br/>
													</c:if>
													<c:if test="${sendPlanForm.desc!=null && ''!=sendPlanForm.desc}">
														描述：${sendPlanForm.desc}
													</c:if>
												</td>
												<td class="td3">
													<input type="text" class="input-edit" name="sendNnum" value="${sendPlanForm.sendNnum}" 
														onkeypress="javascript:keyPress(this);"  />${sendPlanForm.measureName}
												</td>
												<td class="td3">
													发货日期：<input type="text" class="input-edit" id="sendDate<%=j%>"  name="sendDate" value="${sendPlanForm.sendDate}" 
														onclick="return showCalendar('sendDate<%=j%>', 'y-mm-dd');"   
														readonly="readonly" /><br/>
													计划到货：<input type="text" class="input-edit"  id="planArrDate<%=j%>"  name="planArrDate" value="${sendPlanForm.planArrDate}"
														onclick="return showCalendar('planArrDate<%=j%>', 'y-mm-dd');"   
														readonly="readonly" />
												</td>
												
												<%
													j = j + 1;
												%>
												
												<td class="td3">
													运输方式：<input type="text" class="input-edit" name="transferName" value="${sendPlanForm.transferName}"/><br/>
													车   牌  号：<input type="text" class="input-edit" name="licenceNo" value="${sendPlanForm.licenceNo}"/><br/>
													联   系  人：<input type="text" class="input-edit" name="linkMan" value="${sendPlanForm.linkMan}"/><br/>
													联系方式：<input type="text" class="input-edit"  name="linkMode" value="${sendPlanForm.linkMode}"/><br/>
													备&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;注：<input type="text" class="input-edit"  name="memo" value="${sendPlanForm.memo}"/>
												</td>
											</tr>
											<c:if test="${orderItemForm.index%2==1}">
												<tr boder='1' class="contTr-old" style="height: 28px">
											</c:if>
											<c:if test="${orderItemForm.index%2==0}">
												<tr boder='1' class="contTr-even" style="height: 28px">
											</c:if>
												<td align="left" colspan="2" class="td2">
													收货公司：<c:if test="${sendPlanForm.receiveCorpName!=null && ''!=sendPlanForm.receiveCorpName}">${sendPlanForm.receiveCorpName}</c:if>
														     <c:if test="${sendPlanForm.receiveCorpName==null || ''==sendPlanForm.receiveCorpName}">暂无</c:if>
												</td>
												<td align="left" colspan="3" class="td2">
													收货地址：<c:if test="${sendPlanForm.receiveAdsName!=null && ''!=sendPlanForm.receiveAdsName}">${sendPlanForm.receiveAdsName}</c:if>
														     <c:if test="${sendPlanForm.receiveAdsName==null || ''==sendPlanForm.receiveAdsName}">暂无</c:if>
												</td>
											</tr>
										</c:if>
									</c:forEach>
								</c:if>
	                        </table>
	                        <br/><br/>
	                        <table width="600" align="center" border="0" cellspacing="0" cellpadding="0">
					            <tr id="order_confirm" align="center">
					                <td>
					                    <input type="button" class="btnscs" value="提交" onclick="saveArrPlan()" />
					                    &nbsp;&nbsp;&nbsp;&nbsp;
					                </td>
					            </tr>
					        </table>
	                	</form>
                    </div>
                    <div class="margin8">
                    	<table align="left">
							<tr class="title">
								<td>
									<div id="message" class="msgcolor">${system_err_msg}</div>
								</td>
							</tr>
						</table>
					</div> 
                </div>
            </div>
        <div class="margin20"></div>
<!--    </div>-->
</body>
</html>
